<?=
get_toolbar(array('accion' => 'custom',
    'botones' => '<a href="' . site_url(get_uri_string()) . '" class="btn btn-warning color-blanco">' . ulang('ver_listado_empresas') . '</a>'));
?>
<?= get_alert(isset($success) ? $success : null, isset($error) ? $error : null); ?>
<div class="row">
    <div class="col-md-12">
        <div class="portlet box blue" id="form_wizard_1">
            <div class="portlet-title">
                <div class="caption">
                    <i class="icon-reorder"></i> <?= ulang('nueva_empresa') ?> - <span class="step-title"><?= ulang('paso') ?> 1 <?= lang('de') ?> 3</span>
                </div>
            </div>
            <div class="portlet-body form">
                <form class="form-horizontal" action="<?= site_url($this->uri->uri_string()) ?>" id="form_mantenimiento" method="post">
                    <div class="form-wizard">
                        <div class="form-body">
                            <?= $wizard ?>
                            <div id="bar" class="progress progress-striped" role="progressbar">
                                <div class="progress-bar progress-bar-important" style="width: 66%;"></div>
                            </div>
                            <div class="tab-pane active" id="tab1">
                                <div class="form-group">
                                    <label class="control-label col-md-4">* <?= ulang('emp_category') ?></label>
                                    <div class="col-md-5">
                                        <select class="form-control" name="ece_fk_emp_categoria[]">
                                            <?php foreach ($infocategorias as $cat) {
                                                $catselected = '';
                                                foreach ($infoempresa['d_categorias'] as $catempresa) {
                                                    if($catempresa['emc_id'] == $cat['emc_id']){
                                                        $catselected = 'selected';
                                                    }
                                                }?>
                                                <option value="<?= $cat['emc_id'] ?>" <?=$catselected?>>
                                                    <?= ulang($cat['emc_slug']) ?>
                                                </option>
                                            <?php } ?>
                                        </select>
                                        <span class="help-block"><?= ulang('help_emp_category') ?></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-4">* <?= ulang('emp_desc') ?></label>
                                    <div class="col-md-5">
                                        <textarea class="form-control" placeholder="<?= ulang('emp_desc') ?>" rows="3" name="emp_desc"><?= isset($infoempresa) ? isset($infoempresa['emp_desc']) ? $infoempresa['emp_desc'] : ''  : '' ?></textarea>
                                        <span class="help-block"><?= ulang('help_emp_desc') ?></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-4">* <?= ulang('emp_direccion') ?></label>
                                    <div class="col-md-5">
                                        <input type="text" value="<?= isset($infoempresa) ? isset($infoempresa['emp_direccion']) ? $infoempresa['emp_direccion'] : ''  : '' ?>" 
                                               name="emp_direccion" class="form-control" placeholder="<?= ulang('emp_direccion') ?>"/>
                                        <span class="help-block"><?= ulang('emp_direccion') ?></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-4"><?= ulang('emp_codigo_postal') ?></label>
                                    <div class="col-md-5">
                                        <input type="text" value="<?= isset($infoempresa) ? isset($infoempresa['emp_codigo_postal']) ? $infoempresa['emp_codigo_postal'] : ''  : '' ?>" 
                                               name="emp_codigo_postal" class="form-control" placeholder="<?= ulang('emp_codigo_postal') ?>"/>
                                        <span class="help-block"><?= ulang('emp_codigo_postal') ?></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-4"><?= ulang('emp_telefono') ?></label>
                                    <div class="col-md-5">
                                        <input type="text" value="<?= isset($infoempresa) ? isset($infoempresa['emp_telefono']) ? $infoempresa['emp_telefono'] : ''  : '' ?>" 
                                               name="emp_telefono" class="form-control" placeholder="<?= ulang('emp_telefono') ?>"/>
                                        <span class="help-block"><?= ulang('help_emp_nombre') ?></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-4"><?= ulang('emp_web') ?></label>
                                    <div class="col-md-5">
                                        <input type="text" value="<?= isset($infoempresa) ? isset($infoempresa['emp_web']) ? $infoempresa['emp_web'] : ''  : '' ?>" 
                                               name="emp_web" class="form-control" placeholder="<?= ulang('emp_web') ?>"/>
                                        <span class="help-block"><?= ulang('emp_web') ?></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-4">* <?= "¿".ulang('emp_fk_municipio')."?" ?></label>
                                    <div class="col-md-5">
                                        <select class="form-control" name="emp_fk_municipio">
                                            <?php foreach ($infomunicipio as $mun) {
                                                $munselected = '';
                                                if($infoempresa['emp_fk_municipio'] == $mun['mun_id']){
                                                    $munselected = 'selected';
                                                }?>
                                                <option value="<?= $mun['mun_id'] ?>" <?=$munselected?>>
                                                    <?= $mun['mun_desc'] ?>
                                                </option>
                                            <?php } ?>
                                        </select>
                                        <span class="help-block"><?= ulang('emp_fk_municipio') ?></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-md-4"></div>
                                    <div class="col-md-5">
                                        <button type="submit" id="boton_grabar" class="btn btn-info"><?= ulang('grabar_y_pasar_a_la_siguiente_pantalla') ?></button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>